<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<form method="post" action="${rootUrl}/system/group-role"  class="required-validate" onsubmit="return validateCallback(this)">
	<input type="hidden" name="id" value="${id}" />
	<div layoutH="36" style="float:left; display:block; overflow:auto; width:400px; border:solid 1px #CCC; line-height:21px; background:#fff">
		<ul class="tree treeFolder treeCheck expand" oncheck="show">
			<li><a>角色</a>
				<ul>
					${roles}
				</ul>
			</li>
		</ul>
	</div>
	<div id="roleShowBox" layoutH="36" style="float:left; overflow:hidden; display:block; width:400px;  background:#fff">
		
	</div>
	<div class="formBar">
		<ul>
			<li><div class="buttonActive"><div class="buttonContent"><button type="submit">保存</button></div></div></li>
		</ul>
	</div>
</form>
	
<script type="text/javascript">
function show(){
	var json = arguments[0];
	
	$(json.items).each(function(i){
		if(i==0){
		$.ajax({
			type:'GET',
			url:"${rootUrl}/system/role/"+this.value+"/detail",
			dataType:"html",
			cache: false,
			success: function(data){
				$("#roleShowBox").html(data);
			},
			error: DWZ.ajaxError
		});
		}
		
	});
}
</script>